package Mediator_pattern;

import java.util.HashMap;

public class ConcreteMediator extends Mediator{

    private HashMap<String ,Colleague>colleagueMap;
    private HashMap<String,String> interMap;

    public ConcreteMediator(HashMap<String, Colleague> colleagueMap, HashMap<String, String> interMap) {
        this.colleagueMap = colleagueMap;
        this.interMap = interMap;
    }

    @Override
    public void Register(String colleaguName, Colleague colleague) {
        colleagueMap.put(colleaguName,colleague);

        if (colleague instanceof Alarm){
            interMap.put("Alarm",colleaguName);
        }else if (colleague instanceof CoffeeMachine){
            interMap.put("CoffeeMachine",colleaguName);
        }else if (colleague instanceof TV){
            interMap.put("TV",colleaguName);
        }else if (colleague instanceof Curtains){
            interMap.put("Curtains",colleaguName);
        }
    }

    @Override
    public void getMessage(int stateChange, String colleague) {
            if (colleagueMap.get(colleagueName) instanceof Alarm){
                if (stateChange == 0){


                }
            }
    }

    @Override
    public void SendMessage() {

    }
}
